package com.wing.product.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.common.utils.PageResult;
import com.wing.product.model.entity.WarehouseSignOrder;
import com.wing.product.model.entity.WarehouseSignOrderDetail;
import com.wing.product.model.response.WarehouseSignOrderVO;
import com.wing.product.service.WarehouseSignOrderDetailService;
import com.wing.product.service.WarehouseSignOrderDetailServiceImpl;
import com.wing.product.service.WarehouseSignOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.Map;

/**
* 签收订单详情(warehouse_sign_order_detail)表控制层
*
* @author xxxxx
*/
@Api(value = "签收明细", tags = "#/warehouse/product/signOrderDetail")
@RestController("WarehouseSignOrderDetailController")
@RequestMapping("/warehouse/signOrderDetail")
@RequiredArgsConstructor
public class WarehouseSignOrderDetailController {
/**
* 服务对象
*/
    @Autowired
    private WarehouseSignOrderDetailService warehouseSignOrderDetailService;


    @Autowired
    private WarehouseSignOrderService warehouseSignOrderService;


    @ApiOperation(value = "查询列表", notes = "搜索")
    @GetMapping("/list")
    public PageResult<WarehouseSignOrderVO> list(
            @RequestParam(value = "page", defaultValue = "1", required = false) Integer page
            ,@RequestParam(value = "limit", defaultValue = "10", required = false) Integer limit
            ,@RequestParam(value = "sort", defaultValue = "create_time", required = false) String sort
            ,@RequestParam(value = "order", defaultValue = "asc", required = false) String order
            ,String userBundleCode
    ){

        Page<WarehouseSignOrder> pg = new Page<>(page, limit);
        Map paramMap=new HashMap();
        paramMap.put("userBundleCode",userBundleCode);
        //搜索
//        return warehouseSignOrderService.pageList4app(pg,paramMap);
        IPage<WarehouseSignOrderVO> list = warehouseSignOrderService.List4app(pg,paramMap);
        return new PageResult<>(list.getRecords(), list.getTotal());
    }





}
